{template header}

<!--{if empty($infloat)}-->
	{subtemplate header_nofloat}
<!--{/if}-->

<!--{if $action == 'rate'}-->

<div class="float" id="floatlayout_topicadmin">
<div class="floatboxnarrow">
<h3 class="float_ctrl">
	<em id="return_rate">{lang rate}</em>
	<span>
		<!--{if !empty($infloat)}--><a href="javascript:;" class="float_close" onclick="floatwin('close_rate')" title="{lang close}">{lang close}</a><!--{/if}-->
	</span>
</h3>

<form id="rateform" method="post" action="misc.php?action=rate&ratesubmit=yes&infloat=yes" onsubmit="ajaxpost('rateform', 'return_rate', 'return_rate', 'onerror');return false;">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="tid" value="$tid">
<input type="hidden" name="pid" value="$pid">
<!--{if !empty($infloat)}--><input type="hidden" name="handlekey" value="rate"><!--{/if}-->

<div class="postbox">
<div class="rateopt">
<!--{loop $ratelist $id $options}-->
	<div class="hasdropdownbtn ratelist s_clear">
		<label for="score$id" title="{lang rate_quota_today}">{$extcredits[$id][img]} {$extcredits[$id][title]}</label>
		<input type="text" id="score$id" name="score$id" value="0" class="txt" /> 
		<a href="javascript:;" class="dropdownbtn" onclick="InFloat='floatlayout_rate';showselect(this, 'score$id', 'scoreoption$id')">^</a>		
		<ul id="scoreoption$id" style="display:none">$options</ul>		
	</div>
<!--{/loop}-->
</div>

<div class="topicadminlog">
	<h4>
		<span class="hasdropdownbtn right"><a onclick="InFloat='floatlayout_rate';showselect(this, 'reason', 'reasonselect')" class="dropdownbtn" href="javascript:;">^</a></span>
		{lang admin_operation_explain}:
	</h4>
	<p><textarea id="reason" name="reason" class="txtarea" onkeyup="seditor_ctlent(event, '$(\'rateform\').ratesubmit.click()')"></textarea></p>
	<ul id="reasonselect" style="display: none">{echo modreasonselect()}</ul>
	<p>
		<input name="ratesubmit" type="submit" value="{lang confirms}" />
		<input type="checkbox" name="sendreasonpm" id="sendreasonpm" class="checkbox"{if $reasonpm == 2 || $reasonpm == 3} checked="checked" disabled="disabled"{/if} /> <label for="sendreasonpm" />{lang admin_pm}</label>
	</p>
</div>
</div>
</form>
</div>
</div>

<!--{elseif $action == 'removerate'}-->

<div class="float">
<div class="floatbox" style="height: 410px">
<h3 class="float_ctrl">
	<em id="return_rate">{lang thread_removerate}</em>
	<span>
		<!--{if !empty($infloat)}--><a href="javascript:;" class="float_close" onclick="floatwin('close_rate')" title="{lang close}">{lang close}</a><!--{/if}-->
	</span>
</h3>

<form id="rateform" method="post" action="misc.php?action=removerate&ratesubmit=yes&infloat=yes" onsubmit="ajaxpost('rateform', 'return_rate', 'return_rate', 'onerror');return false;">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="tid" value="$tid">
<input type="hidden" name="pid" value="$pid">
<!--{if !empty($infloat)}--><input type="hidden" name="handlekey" value="rate"><!--{/if}-->
<div class="floatwrap">
<table class="list" cellspacing="0" cellpadding="0">
<thead>
	<tr>
		<td>&nbsp;</td>
		<td>{lang username}</td>
		<td>{lang time}</td>
		<td>{lang credits}</td>
		<td>{lang reason}</td>
	</tr>
</thead>
<!--{loop $ratelogs $ratelog}-->
	<tr>
		<td><input type="checkbox" name="logidarray[]" value="$ratelog[uid] $ratelog[extcredits] $ratelog[dbdateline]" /></td>
		<td><a href="space.php?uid=$ratelog[uid]">$ratelog[username]</a></td>
		<td>$ratelog[dateline]</td>
		<td>{$extcredits[$ratelog[extcredits]][title]} <span class="bold">$ratelog[scoreview]</span> {$extcredits[$ratelog[extcredits]][unit]}</td>
		<td>$ratelog[reason]</td>
	</tr>
<!--{/loop}-->
</table>
</div>

<div class="postbox">
<p style="float:right">
	<input type="checkbox" name="sendreasonpm" id="sendreasonpm" class="checkbox"{if $reasonpm == 2 || $reasonpm == 3} checked="checked" disabled="disabled"{/if} /> <label for="sendreasonpm" />{lang admin_pm}</label>&nbsp;&nbsp;
	{lang admin_operation_explain}: <input name="reason" class="txt">
</p>
<label><input class="checkbox header" type="checkbox" name="chkall" onclick="checkall(this.form, 'logid')" /> {lang checkall}</label>&nbsp;&nbsp;
<button class="submit" type="submit" value="true" name="ratesubmit">{lang submit}</button>
</div>

</form>
</div>
</div>
	
<!--{/if}-->

<script type="text/javascript" reload="1">
function submithandle_rate(locationhref) {
	ajaxget('viewthread.php?tid=$tid&viewpid=$pid', 'post_$pid', 'post_$pid');
	floatwinreset = 1;
	floatwin('close_rate');
}
</script>

<!--{if empty($infloat)}-->
	{subtemplate footer_nofloat}
<!--{/if}-->
{template footer}